#include <iostream>
#include <string>

using namespace std;

int main() {
  string str1 = "runoob";
  string str2 = "google";
  string str3;
  int len;

  cout << "str1 = " << str1 << endl;
  str1 += ":";
  cout << "str1 = " << str1 << endl;
  // 复制 str1 到 str3
  str3 = str1;
  cout << "str3 : " << str3 << endl;

  // 连接 str1 和 str2
  str3 = str1 + str2;
  cout << "str1 + str2 : " << str3 << endl;

  // 连接后，str3 的总长度
  len = str3.size();
  cout << "str3.size() :  " << len << endl;

  cout << str3.at(0) << endl;
  cout << str3[1] << endl;

  string str31 = str1.append(str2);
  cout << "str31 = " << str31 << endl;

  string str4 = str31.append("game cache", 4);
  cout << "str4 = " << str4 << endl;

  string str5 = str31.append("game cache", 5,5);
  cout << "str5 = " << str5 << endl;
  return 0;
}